package Invaders;

import java.awt.Dimension;
import javax.swing.ImageIcon;

public class InvaderHorizontal extends Invader{
	
	public InvaderHorizontal(Dimension a) {
		super(a);
		icon = new ImageIcon(getClass().getResource("/Sprites/invaderblue.gif")).getImage();
		score = 1;
		life = 1;
	}

	public void move() {
	    if (estaAtivo) {
	    	x += dx;
	    	if (x < 0) { 
	    		dx = -dx; 
	    		x += dx; 
	    	} 
	    	if (y < 0) { 
	    		dy = -dy; 
	    		y += dy; 
	    	} 
	    	if (x > area.width-iw) { 
	    		dx = -dx; 
	    		x += dx; 
	    	} 
	    	if (y > area.height-ih) { 
	    		dy = -dy; 
	    		y += dy; 
	    	}
	    	//if (y > area.height-100-ih/2) { dy = -dy; y += dy; }
  		}
    }
}
